<?php
/**
 * Created by 陈俊伟.
 * User: Administrator
 * Date: 2019-10-28
 * Time: 下午 2:52
 */

namespace App\Lib\PHPExcel\ManuOrder;

use App\Lib\PHPExcel\ExcelHandle;

class Sett extends ExcelHandle
{
    /*
     * 工厂模式
     * 结算定制
     * */
    public function arrange($origin_arr)
    {

        $arr = [
            0 => [
                '订单号', '店铺名', '订单提交时间', '订单价格', '订单状态','在线支付(结算)','实际结算金额(结算)','平台服务费','渠道'
            ]
        ];
        $i = 1;
        foreach ($origin_arr as $data) {
            $arr[$i]['订单号'] = $data['order_id'];
            $arr[$i]['店铺名'] = $data['shop_name'];
            $arr[$i]['订单提交时间'] = $data['create_time'];
            $arr[$i]['订单价格'] = $data['total_amount'];
            $arr[$i]['订单状态'] = $data['order_status'];
            $arr[$i]['在线支付(结算)'] = $data['sett_payment_online'];
            $arr[$i]['实际结算金额(结算)'] = $data['sett_total_amount'];
            $arr[$i]['平台服务费'] = abs($data['sett_ptfwf']);
            $arr[$i]['渠道(结算)'] = $data['sett_type'];
            $i++;
        }

        return $arr;
    }


}